/*
 * @Description: 短信配置
 * @Version: 2.0
 * @Author: Symbol_Yang
 * @Date: 2022-06-07 09:51:24
 * @LastEditors: Symbol_Yang
 * @LastEditTime: 2022-10-27 16:53:21
 */
const mongoose = require('mongoose')
const {Schema} = mongoose
//


var ShortMsgSchema = new Schema({ 
    templateName: {type: String, required: true},                          //   内容
    appId: {type: String, required: true}, 
    signName: {type: String, required: true}, 
    templateId: {type: String, required: true}, 
    hasIncludeParams: {type: Boolean, required: true, default: true}, // 是否带参数
    create_at: {type: Date, default: Date.now, index: -1},
    update_at: {type: Date, default: Date.now},
})

ShortMsgSchema.pre('save', function (next) {
    let now = new Date()
    this.update_at = now
    next()
})
mongoose.model('short_msg', ShortMsgSchema)
module.exports = ShortMsgSchema
